//
//  QiniuExtensions.swift
//  FoundationCustom
//
//  Created by ZhouJiatao on 2019/10/23.
//  Copyright © 2019 Unknow. All rights reserved.
//

import Foundation

// 七牛云存储的相关拓展

extension String {
    // 缩略图参考文档： https://developer.qiniu.com/dora/api/1279/basic-processing-images-imageview2
    
    /// 最长边不超过指定长度（等比例缩放）
    public func qn_imgUrl(longEdgeLessThan lenght: Int) -> String {
        return "\(self)?imageView2/0/w/\(lenght)"
    }
    /// 限定宽度最多为lenght（等比例缩放）
    public func qn_imgUrl(widthLessThan lenght: Int) -> String {
        return "\(self)?imageView2/2/w/\(lenght)"
    }
}
